Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use enums for settings in SRAM header #2429

Merged
merged 4 commits into from
Feb 16, 2025
Merged

Conversation

cadmic
Copy link
Contributor

@cadmic cadmic commented Jan 17, 2025

I put the AudioSetting enum in z64audio.h since it's used in audio code, but confusingly there's also the SoundMode enum which is almost the same but isn't. I named the function that translates between them as Audio_SetAudioSetting but this name feels doubly redundant. Suggestions welcome

/* 0x00 */ SRAM_HEADER_SOUND,
/* 0x01 */ SRAM_HEADER_ZTARGET,
/* 0x00 */ SRAM_HEADER_AUDIO,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was previously called "sound" because that is what it is called in file select. And the options in the sram header correspond directly with the options in file select.
Currently thinking it makes sense to stay aligned with file select, but more thoughts welcome

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to rename gSaveContext.audioSetting and AudioSetting too then. What should we call those? And what about what is now SoundMode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question. would like to get @engineer124 involved if he sees this. will put some thought into it in the meantime

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coming back to this, I think I would be okay with SoundSetting for the file select-side value, and SoundMode for the internal value.
Its not perfect but we can just do that for now and get this moving

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sound good thanks, I updated the PR with that (pending bss fixes)

Copy link
Collaborator

@fig02 fig02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw I think the SoundSetting enum probably makes more sense in a game-side header, since the value doesnt mean too much to the audio system (other than when it does the translation in Audio_SetSoundMode)

But we can reorganize later. Merging soon

@cadmic
Copy link
Contributor Author

cadmic commented Feb 15, 2025

hm I thought the audio library was supposed to be self-contained though

@Dragorn421
Copy link
Collaborator

func_800F6700/Audio_SetSoundMode isn't part of the audio library/driver but part of the game specific audio code, which is indeed mostly self contained but afaik doesn't "have to"?

@fig02
Copy link
Collaborator

fig02 commented Feb 15, 2025

Right, the value has meaning in save context and file select. Seems to me like it should live in save.h. The audio system doesnt care about the setting value except for that one translation layer function

@fig02
Copy link
Collaborator

fig02 commented Feb 15, 2025

build failed again

@fig02 fig02 merged commit aba3720 into zeldaret:main Feb 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants